package com.aztec.ims.client;

import com.aztec.ims.client.VendorDetailsServiceImplStub.CreateVendorRequest;

public class VendorDetailsServiceClient {
	public static void main(String[] args) {
		try{
            VendorDetailsServiceImplStub stub =
                new VendorDetailsServiceImplStub
                ("http://localhost:8080/axis2/services/VendorDetailsServiceImpl");

            //getPrice(stub);
            createVendor(stub);

        } catch(Exception e){
            e.printStackTrace();
            System.err.println("\n\n\n");
        }

	}
	
    private static void createVendor(VendorDetailsServiceImplStub stub) {
        try{
            CreateVendorRequest param =new CreateVendorRequest();
            param.setVendorId("123");
        	VendorDetailsServiceImplStub.CreateVendor req = new VendorDetailsServiceImplStub.CreateVendor();
            req.setCreateVendorRequest(param);

            VendorDetailsServiceImplStub.CreateVendorResponseE res =
                stub.createVendor(req);

            System.out.println(res.get_return().getVendorId());
        } catch(Exception e){
            e.printStackTrace();
            System.err.println("\n\n\n");
        }
		
		
	}

	public static void getPrice(VendorDetailsServiceImplStub stub){
        try{
        	VendorDetailsServiceImplStub.GetPrice req = new VendorDetailsServiceImplStub.GetPrice();

            req.setSymbol("-");

            VendorDetailsServiceImplStub.GetPriceResponse res =
                stub.getPrice(req);

            System.out.println(res.get_return());
        } catch(Exception e){
            e.printStackTrace();
            System.err.println("\n\n\n");
        }
    }


}
